const fs = require('fs');

const path = require('path');

const error = require('../../common/error');

const filePath = path.resolve(__dirname,'../../temp/data.json');

module.exports=function(data){

  try {

    fs.writeFileSync(filePath,JSON.stringify(data),'utf8');

  } catch (e) {

    error("覆盖临时数据失败，联系作者：" + e.message);

  }
}